home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / AmiVoGL_MDEV.lha / src / pref.c < prev    next >
C/C++ Source or Header  |  1994-04-16  |  1KB  |  71 lines

  1.  
  2. #include "vogl.h"
  3.  
  4. static    long    px = -1, py = -1, pxs = -1, pys = -1;
  5.  
  6. /*
  7.  * prefposition
  8.  *
  9.  *    Specify a prefered position for a window that is
  10.  *    under control of a window manager.
  11.  *    Position is the location of the upper left corner.
  12.  *    Should be called before ginit.
  13.  */
  14. void prefposition(
  15.   long x1,
  16.   long x2,
  17.   long y1,
  18.   long y2)
  19. {
  20. if (x1 < 0 || x2 < 0) verror("prefposition: bad x value");
  21. if (y1 < 0 || y2 < 0) verror("prefposition: bad y value");
  22.  
  23. px  = x1;
  24. py  = y1;
  25. pxs = x2 - x1;
  26. pys = y2 - y1;
  27. }
  28.  
  29. /* ------------------------------------------------------------------------ */
  30.  
  31. /*
  32.  * prefsize
  33.  *
  34.  *    Specify the prefered size for a window under control of
  35.  *    a window manager.
  36.  *    Should be called before ginit.
  37.  */
  38. void prefsize(
  39.   long x,
  40.   long y)
  41. {
  42. if (x < 0) verror("prefsize: bad x value");
  43. if (y < 0) verror("prefsize: bad y value");
  44.  
  45. pxs = x;
  46. pys = y;
  47. }
  48.  
  49. /* ------------------------------------------------------------------------ */
  50.  
  51. /*
  52.  * getprefposandsize
  53.  *
  54.  *    Returns the prefered position and size of a window under
  55.  *    control of a window manager. (-1 for unset parameters)
  56.  */
  57. void getprefposandsize(
  58.   int *x,
  59.   int *y,
  60.   int *xs,
  61.   int *ys)
  62. {
  63. *x  = px;
  64. *y  = py;
  65. *xs = pxs;
  66. *ys = pys;
  67. }
  68.  
  69. /* ------------------------------------------------------------------------ */
  70.  
  71.